/**
 * Copyright (C), 2015-2022, XXX有限公司
 * FileName: UploadController
 * Author:   lenovo
 * Date:     2022/1/28 13:11
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * gdl               2022/1/28           2.0.1              描述
 */
package com.ytc.controller;
import com.ytc.util.FileUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * 〈一句话功能简述〉<br> 
 * @author
 * @create 2022/1/28
 * @since 1.0.0
 */
@Controller
public class UploadController {
    @RequestMapping("upload")
    @ResponseBody
    public Map<String,String> upload(MultipartFile img, HttpServletRequest request){
        String s = FileUtil.FileUpload(img, request);
        Map<String,String> map=new HashMap<>();
        map.put("img",s);
        return map;
    }
}